With respect to one-to-one communication between a master station and a slave station through a loop communication channel, various attempts have been made to time synchronize a timer connected to each slave station in the communication channel with high accuracy.
FIG. 6 shows a block diagram of a timer synchronizing system according to a conventional technique. In a conventional example, as shown in FIG. 6, two communication channels are used to connect a master station 1 with slave stations 2 and 4 and connected between slave stations, to thereby establish bidirectional communication. The master station 1 transmits a communication frame from a transmission/reception circuit 13 to the slave station 2. The slave station 2 receives the communication frame in a transmission/reception circuit 26, and transmits the communication frame to a slave station 3 from the transmission/reception circuit 26. The slave station 3 receives the communication frame in a transmission/reception circuit 36 and transmits the communication frame to the slave station 4 from the transmission/reception circuit 36. The slave station 4 receives the transmission frame in a transmission/reception circuit 46 and transmits the communication frame to the master station 1 from the transmission/reception circuit 46. In this way, loop communication is established. Timer correcting sections 23, 33, and 43 owned by the slave stations correct corresponding slave station timers 24, 34, and 44 based on timer correction times.
FIG. 7 shows a flowchart of a process for setting a timer correction time during initialization of the master and slave stations in the conventional technique. Each of the slave stations waits until a communication frame addressed to the slave station itself is received (S51). After receiving the communication frame addressed to the slave station itself, the slave station transmits the received communication frame to a transmission source located upstream of the slave station (S52) and also transmits the communication frame to another slave station or the master station located downstream of the slave station (S53). Then, the downstream slave or master station waits for the transmission frame transmitted in S52 and S53 (S54), and sets the timer correction time upon receipt of the communication frame (S55).
More specifically, a timer correction time Ts is calculated based on both a communication frame transmission time To in S53 and a communication frame reception time Tr in S54 by the following Equation 1.Ts=(To−Tr)/2  (Equation 1)
Because outward and inward communications between the master station and the adjacent one of the slave stations and between adjacent ones of the slave stations are established over a constant distance, a lag in transmission from the slave station to the master station through the communication channels can be corrected using the timer correction time Ts, which is half the length of time taken to perform transmission and reception. In practice, however, because there is a communication lag caused by relay/reload processing in each of the slave stations, correction of the lag in transmission performed using only the timer correction time Ts will result in occurrence of a synchronous deviation.
FIG. 8 shows a block diagram of the slave station according to another example of the conventional technique. A transmitter/receiver 203 outputs received communication frame data. A transmission destination determining circuit 205 determines whether or not the communication frame data are addressed to its own slave station, and outputs, based on the determined result, a relay/reload switching signal SW-b. In response to the relay/reload switching signal SW-b, a relay/reload switch 206 outputs transmission data 210 through a communication frame reloading circuit 208 when the received transmission frame data are addressed to its own slave station, or outputs through a relaying circuit 207 the received transmission frame data without processing when the received communication frame data are addressed to another station.
The transmitter/receiver 203 outputs, as a communication frame, the data output by the relay/reload switch 206 to a next station. The communication frame reloading circuit 208 outputs, based on the received communication frame data, the timer correction value to the timer correcting unit 23. Based on the timer correction value, the timer correcting section 23 corrects the slave station timer 24 in the slave station in which the timer correcting section 23 is installed.
FIGS. 9 and 10 show flowcharts of a process to set the timer correction time in the master station and the slave station according to the conventional technique. Referring to FIG. 9, the master station 1 transmits to the slave stations 2, 3, and 4 a communication frame that contains timer correction time information obtained by summing up the correction values for synchronizing the timers and delay times caused by relay/reload processing in transit slave stations in the loop communication channel (S40). Referring next to the flowchart of FIG. 10, process steps performed in the slave station 2 are explained as an example. When the communication frame addressed to the slave station 2 is received from the master station 1 (S41), the slave station 2 switches the relay/reload switch 206 (see FIG. 8) to a communication frame reloading circuit side, to perform a communication frame reloading process, and transmits to the master station 1 the communication frame including information indicative of completion of timer correction. Then, the slave station 2 swiftly switches the relay/reload switch 206 to a relaying circuit side to become ready to perform a process of relaying the communication frame to another slave station (S42). Next, the timer correcting unit 23 (see FIG. 8) corrects the slave station timer 24 in the slave station 2 based on the timer correction time information contained in the communication frame (S43). Referring back to FIG. 9, the master station 1 completes initialization when the communication frame including information indicative of completion of timer correction is received from all of the slave stations (S44).
In the process steps as described above, times of the slave stations can be synchronized with the time of the master station in the loop communication channel even when the communication delay occurs due to relay/reload processing in each of the slave stations. In this way, accurate timer synchronization can be achieved even in communication accompanying the process of relaying/reloading the communication frame.